fix: improve chat input UX and IME composition handling (revised)#213
fix: improve chat input UX and IME composition handling (revised)#213JiahaoZhu11 wants to merge 8 commits intodifferent-ai:devfrom
Conversation
Chat Input UX Improvements: - Make entire input bubble clickable to focus the textarea - Add cursor-text style to indicate the bubble is an input area - Disable pointer events on send button when hidden (no text entered) - Only show tooltip on send button when it's visible - Remove focus outline from textarea (outer bubble shows focus state) IME Composition Handling: - Track composition state via compositionstart/compositionend events - Use skipNextEnter flag to ignore the Enter key that confirms IME selection - Fixes issue where pressing Enter during Chinese/Japanese/Korean input would send the message instead of confirming character selection
|
The following comment was made by an LLM, it may be inaccurate: |
Updated the openwork dependency from version 0.3.4 to 0.3.5 in Cargo.lock.
- Add click-to-focus on input container with cursor-text visual hint - Add outline-none to textarea for cleaner focus state - Add disabled:pointer-events-none to run button - Make run button title conditional on prompt content
@benjaminshafii Thanks for the review of #195! I ended up recreating the branch and PR—there were just too many conflicts since we were all touching the same component.. 1. Rebase: ✅ Done - rebased on latest 2. The flag is safe by design - it can only become
Tested locally with both IME and normal typing - no issues observed. IME.Typing.movNormal.Typing.mov |
|
@benjaminshafii Just wanted to check in—if there's anything you'd like me to adjust or clarify, let me know! Otherwise, I appreciate your time reviewing this. |
322b211 to
c836a83
Compare
142d583 to
2ce2ef4
Compare
Refactored the syncHeight function to allow CSS to handle sizing when the editor is empty, ensuring better handling of min-height and padding. This prevents unnecessary height adjustments and improves overflow behavior.
|
@benjaminshafii Ben, while this quick fix addresses an immediate issue, the most critical change is still pending: fixing the IME enter behavior. You can view the videos below to see the difference: Before: Before.movAfter: After.movIn addition, I've implemented three UI/UX improvements:
|
Summary
This PR improves the chat input component with two main enhancements:
This is a revised version of #195.
Changes
Chat Input UX
cursor-textcursor style to indicate the bubble is interactivefocus-withinIME Composition Fix
compositionstart/compositionendevent handlers to track IME stateskipNextEnterflag to differentiate between:Testing